#pragma once

// Types
typedef unsigned __int8		u8;		/// 8 bit unsigned variable.
typedef __int8				s8;		/// 8 bit signed variable.
typedef char				c8;		/// 8 bit character variable.
typedef unsigned __int16	u16;	/// 16 bit unsigned variable.
typedef __int16				s16;	/// 16 bit signed variable.
typedef unsigned __int32	u32;	/// 32 bit unsigned variable.
typedef __int32				s32;	/// 32 bit signed variable.
typedef float				f32;	/// 32 bit floating point variable.
typedef double				f64;	/// 64 bit floating point variable.

typedef std::string			String;

/// Memory macros
#define SAFE_DELETE(P)		if(P) { delete (P);         (P) = NULL; }
#define SAFE_ARRAY_DELETE(P)if(P) { delete[] (P);       (P) = NULL; }
#define SAFE_RELEASE(P)		if(P) { (P)->Release();     (P) = NULL; }
#define SAFE_DESTROY(P)		if(P) { ::DestroyWindow(P); (P) = NULL; }

/// Class macros
#define CONSTRUCTOR
#define DESTRUCTOR  virtual

/// Common constants
const u16 CURRENT_LANGUAGE	= MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
const s32 INVALID_INDEX       = -1;
const u32 BUFFER_SIZE         = 2048;
const String STRING_DATE_FORMAT   = "dddd\',\' MMMM dd yyyy";
const String STRING_TIME_FORMAT   = "HH\':\'mm\':\'ss";